//
//  FoldingTableViewController.swift
//  elarc01
//
//  Created by elarc on 16/6/27.
//  Copyright © 2016年 elarc. All rights reserved.
//

import UIKit

class FoldingTableViewController: UITableViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.tableView.tableFooterView = UIView()
        self.tableView.separatorStyle = UITableViewCellSeparatorStyle.None
        
//        self.navigationController?.setNavigationBarHidden(true, animated: true)
        UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)
        
        let headView = CoolView(frame: CGRectMake(0, 0, CGRectGetWidth(self.view.frame), 205.0), backGroundImage:"background"  ,headerImageURL:"http://d.hiphotos.baidu.com/image/pic/item/0ff41bd5ad6eddc4f263b0fc3adbb6fd52663334.jpg",title:"汉子!", subTitle:"个性签名, 啦啦啦!")
        headView.scrollView = self.tableView
        headView.imgActionBlock = {
            
            print("点击头像")
            
        }
        self.view.addSubview(headView)
        self.tableView.backgroundColor = UIColor.redColor()

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    // MARK: - Table view data source

    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        // #warning Incomplete implementation, return the number of sections
        return 1
    }

    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        // #warning Incomplete implementation, return the number of rows
        return 5
    }

    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cellId = "foldingCell"
        var cell = tableView.dequeueReusableCellWithIdentifier(cellId) as? FoldingSubCell
        if  cell == nil {
            cell = FoldingSubCell(style: UITableViewCellStyle.Value1, reuseIdentifier: cellId)
        }

        

        return cell!
    }

}
